#pragma once

#include "MouseHook.hpp"
#include "Hook.hpp"




/**
 * The MouseHookHelper class helps to connect MouseHook instances with
 * the plain old Win32 hooks procedure, registered with windows.
 *
 * The class registers a static function (mouseHook in this case) with windows,
 * through SetWindowsHookEx and forwards those messages to the only static instance
 * of MouseHookHelper.
 */
class MouseHookHelper : public Hook<MouseHook,WH_MOUSE>
{
public:

	 MouseHookHelper();
	~MouseHookHelper();

private:

	/**
	 * This function does some message preprocessing and then dispatches
	 * the messages to all instances of MouseHook.
	 */
	LRESULT mouseProc(int message, WPARAM wParam, LPARAM lParam) const;



	/**
	 * The static function that is registered with windows.
	 */
	static LRESULT CALLBACK mouseHook(int nCode, WPARAM wParam, LPARAM lParam);
};
///////////////////////////////////////////////////////////////////////////////////////////////////
